<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    li {
        width: 100px;
        height: 100px;
        margin: 0 20px;
        background-color: #fff;
        border: 1px solid black;
    }

    .cl {
        background-color: red;
    }

    .cc {
        background-color: #fff;
    }
</style>

<body>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <p>qqqq</p>
    </ul>
    <script>
        const fu = document.querySelector('ul')
        const son = document.querySelectorAll('li')
        console.log(son);

        fu.addEventListener('click', function (e) {
            if (e.target.tagName === 'LI') {
                e.target.classList.add('cl')

            }


        })


    </script>
</body>

</html>